//
// Created by admin on 2023-6-18.
//
#include <iostream>
#include <vector>
#include "common.h"
#include "auto_structured_bind.h"

using std::vector;
using std::pair;
using std::string;

template <typename T, typename U>
inline void func_auto_structured_bind(const vector<pair<T, U>>& v) 
{
    // 结构化绑定
    for (auto [x, y] : v) {
        print_pair(x, y);
    }
    
}

int main()
{
    vector<pair<string, int>> p;
    p.push_back(pair("Hi1", 11));
    p.push_back(pair("Hi2", 12));
    p.push_back(pair("Hi3", 13));
    p.push_back(pair("Hi4", 14));
    p.push_back(pair("Hi5", 15));
    func_auto_structured_bind(p);
    return 0;
}
